package com.jt.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.jt.pojo.Rights;
import com.jt.service.RightsService;
import com.jt.vo.SysResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@CrossOrigin
@RequestMapping("/rights")
public class RightsController {

    @Autowired
    public RightsService rightsService;

    /**
     * 需求: 查询权限列表信息 只查询两级权限列表信息
     * URl: /rights/getRightsList
     * 请求方式: GET
     * 参数: 无
     * 返回值结果: SysResult对象(List集合)
     */
    @GetMapping("/getRightsList")
    public SysResult getRightsList(){

        List<Rights> rightsList = rightsService.getRighrsList();
        return SysResult.success(rightsList);
    }
}
